home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-03 / qbasicpg.zip / LINE-2.BAS < prev    next >
BASIC Source File  |  1989-08-31  |  859b  |  32 lines

  1. ' LINE-2.BAS
  2. ' This program demonstrates the box-drawing capabilities
  3. '   of the LINE statement.
  4.  
  5. CLS
  6.  
  7. INPUT "Please enter a screen mode (0-13):  ", modeNum%
  8. INPUT "How many colors?  ", numColors%
  9. INPUT "Hollow or solid boxes (H or F)?  ", box$
  10. SCREEN modeNum%
  11.  
  12. CONST DELAY% = 800
  13.  
  14. DO
  15.     shade% = INT(RND(1) * numColors%) + 1    ' line color
  16.     x1pos% = INT(RND(1) * 320)               ' start coordinates
  17.     y1pos% = INT(RND(1) * 200)
  18.     x2pos% = INT(RND(1) * 320)               ' end coordinates
  19.     y2pos% = INT(RND(1) * 200)
  20.    
  21.     IF UCASE$(box$) = "H" THEN
  22.         LINE (x1pos%, y1pos%)-(x2pos%, y2pos%), shade%, B
  23.     ELSEIF UCASE$(box$) = "F" THEN
  24.         LINE (x1pos%, y1pos%)-(x2pos%, y2pos%), shade%, BF
  25.     END IF
  26.  
  27.     FOR i% = 1 TO DELAY%                     ' delay loop
  28.     NEXT i%
  29.  
  30. LOOP UNTIL INKEY$ <> ""
  31.  
  32.